package naga.x.platform2.support;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import naga.x.platform2.app.support.RechargeSupport;

@WebListener
public class AppListener implements ServletContextListener {

	@Autowired
	private RechargeSupport recharge;
	
	private static final Logger LOG = LoggerFactory.getLogger(AppListener.class);
	
	@Override
	public void contextInitialized(ServletContextEvent sce) {
		LOG.info("[APP INIT]OK");
	}

	@Override
	public void contextDestroyed(ServletContextEvent sce) {
		recharge.close();
		LOG.info("[APP CLOSE]OK");
	}

}
